<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String basePath = pageContext.getServletContext().getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <%@include file="../../common/common-css.jsp" %>
    <script type="text/javascript" src="../js/jquery-1.4.min.js"></script>
    <link rel="stylesheet" href="../css/bootstrap.min.css"/>
    <style type="text/css">
      input{font-size: 12px}
    </style>
    <script type="text/javascript">
    	$(function(){
    		 //获取当前网址，如： http://localhost:8083/myproj/view/my.jsp
    		   var curWwwPath=window.document.location.href;
    		   //获取主机地址之后的目录，如： myproj/view/my.jsp
    		  var pathName=window.document.location.pathname;
    		  var pos=curWwwPath.indexOf(pathName);
    		  //获取主机地址，如： http://localhost:8083
    		  var localhostPaht=curWwwPath.substring(0,pos);
    		  //获取带"/"的项目名，如：/myproj
    		  var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
    		 //得到了 http://localhost:8083/myproj
    		  var realPath=localhostPaht+projectName;
    		 
    		$("#backBt").click(function(){
    			window.location.href=realPath+"/role/getRoleList";
    		});
    	})
    </script>
<!--  返回上一次目录    onclick="javascript:window.location.href='javascript:history.go(-1)'" -->
  </head>
  
  <body>
 <body>
  <div class="panel panel-default panel-success">
	  <div class="panel-heading ">
		  <h1 class="panel-title text-center">
			  新增角色
		  </h1>
	  </div>
	  <div class="panel-body">
		  <form class="form-horizontal" action="${pageContext.servletContext.contextPath }/role/insertRole" method="post">
			  <div class="form-group">
				  <label  class="col-sm-4 control-label">名称：</label>
				  <div class="col-sm-4">
					  <input type="text" class="form-control" name="roleName" value="${$result.roleName}" placeholder="角色名称">
				  </div>
			  </div>
			  <div class="form-group">
				  <label class="col-sm-4 control-label">性别：</label>
				  <div class="col-sm-1">
					  <input  type="radio" class="col-md-3" name="status" checked="checked" <c:if test="${result.status eq '1'}">checked="checked"</c:if> value="1"/>启用
				  </div>
				  <div class="col-sm-1">
					  <input  type="radio" class="col-md-3"  name="status" <c:if test="${result.status eq '0'}">checked="checked"</c:if> value="0"/>禁用
				  </div>
			  </div>
			  <div class="form-group">
				  <div class="col-sm-offset-5 col-sm-5">
					  <input type="submit" value="　保　存　" class="btn btn-success"/>　
					  <input id="backBt" type="button" value="　返　回　" class="btn btn-success" />
				  </div>
			  </div>
		  </form>
	  </div>
  </div>
  </body>
</html>
